$(document).ready(function(){
	$.ajax({
		type:'GET',
		cache:false,
		url:rootPath+"/getStudentById",
		async:true,
		data:{
			StudentId:student_id
		},
		success:function(result)
		{
			var image1 = result.extend.student.image;
			
			var name = result.extend.student.name;//1
			var gender = result.extend.student.gender;
			var nation = result.extend.student.nation;
			
			var examineeType = result.extend.student.examineeType;//2
			var graduationType = result.extend.student.graduationType;
			var applyType = result.extend.student.applyType;
			
			var cardId = result.extend.student.cardId;//3
			
			var birthday = result.extend.student.birthday;//4
			
			var eamineeId = result.extend.student.eamineeId;//5
			var provinces = result.extend.student.provinces;
			var regions = result.extend.student.regions;
			var city = result.extend.student.city;
			
			var gradSchool = result.extend.student.gradSchool;//6
			var intheclass = result.extend.student.intheclass;
			
			var mailingAddress = result.extend.student.mailingAddress;//7
			var postalCode = result.extend.student.postalCode;
			var addressee = result.extend.student.addressee;
			var addrTele = result.extend.student.addrTele;
			var telephone = result.extend.student.telephone;
			
			var testType = result.extend.student.testType;//8
			var volunteerOne = result.extend.student.volunteerOne;
			var volunteerTwo = result.extend.student.volunteerTwo;
			var volunteerThree = result.extend.student.volunteerThree;
			var volunteerFour = result.extend.student.volunteerFour;
			var volunteerFive = result.extend.student.volunteerFive;
			
			var promiseType = result.extend.student.promiseType;
			//var payType = result.extend.student.payType;
			
			var curWwwPath=window.document.location.href;
			//获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
			var pathName=window.document.location.pathname;
			var pos=curWwwPath.indexOf(pathName);
			//获取主机地址，如： http://localhost:8083
			var localhostPaht=curWwwPath.substring(0,pos);
			
			document.getElementById("image1").innerHTML = "<img src='"+localhostPaht+"/"+image1+"' style='height: 100%;' />";
			
			document.getElementById("name").innerHTML = name;//1
			switch(gender)
			{
				case 2:document.getElementById("gender").innerHTML = '女';break;
				case 1:document.getElementById("gender").innerHTML = '男';break;
			}
			document.getElementById("nation").innerHTML = nation;
			
			switch(examineeType)//2
			{
				
				case 1:document.getElementById("examineeType").innerHTML = '城镇应届';break;
				case 2:document.getElementById("examineeType").innerHTML = '农村应届';break;
				case 3:document.getElementById("examineeType").innerHTML = '城镇往届';break;
				case 4:document.getElementById("examineeType").innerHTML = '农村往届';break;
			}
			switch (graduationType)
			{
				case 1:
					document.getElementById("graduationType").innerHTML = '高中';
					break;
				case 2:
					document.getElementById("graduationType").innerHTML = '中等师范';
					break;
				case 3:
					document.getElementById("graduationType").innerHTML = '中等专业学校';
					break;
				case 4:
					document.getElementById("graduationType").innerHTML = '职业高中学校';
					break;
				case 5:
					document.getElementById("graduationType").innerHTML = '技工学校';
					break;
			}
			switch(applyType)
			{
				case 1:document.getElementById("applyType").innerHTML = '文史';break;
				case 2:document.getElementById("applyType").innerHTML = '理工';break;
			}
			
			document.getElementById("cardId").innerHTML = cardId;//3
			
			document.getElementById("birthday").innerHTML = birthday;//4
			
			document.getElementById("eamineeId").innerHTML = eamineeId;//5
			document.getElementById("studnet_address").innerHTML = provinces+regions+city;
			
			document.getElementById("gradSchool").innerHTML = gradSchool;//6
			document.getElementById("intheclass").innerHTML = intheclass;
			
			document.getElementById("mailingAddress").innerHTML = mailingAddress;//7
			document.getElementById("postalCode").innerHTML = postalCode;
			document.getElementById("addressee").innerHTML = addressee;
			document.getElementById("addrTele").innerHTML = addrTele;
			document.getElementById("telephone").innerHTML = telephone;
			
			var volunteer = "<ul class='mrdr_b3_u2'><li class='mrdr_l7_1'>第一志愿专业</li><li class='mrdr_b3_l2'>"+volunteerOne+"</li></ul>";
			if(testType==2)
			{
				volunteer += "<ul class='mrdr_b3_u1'><li class='mrdr_l7_1'>第二志愿专业</li><li class='mrdr_b3_l2'>"+volunteerTwo+"</li></ul>";
				volunteer += "<ul class='mrdr_b3_u1'><li class='mrdr_l7_1'>第三志愿专业</li><li class='mrdr_b3_l2'>"+volunteerThree+"</li></ul>";
				volunteer += "<ul class='mrdr_b3_u1'><li class='mrdr_l7_1'>第四志愿专业</li><li class='mrdr_b3_l2'>"+volunteerFour+"</li></ul>";
				volunteer += "<ul class='mrdr_b3_u1'><li class='mrdr_l7_1'>第五志愿专业</li><li class='mrdr_b3_l2'>"+volunteerFive+"</li></ul>";
			}
			document.getElementById("volunteer").innerHTML = volunteer;
			
			if(promiseType == 1)
				document.getElementById("promiseType").innerHTML = "已签署承诺书";
			else
				document.getElementById("promiseType").innerHTML = "未签署承诺书";
			
			
			
		}
	});
	$.ajax({
		type:'GET',
		cache:false,
		url:rootPath+"/getOrdersByStudentId",
		async:true,
		data:{
			StudentId:student_id
		},
		success:function(result)
		{
			var payType =result.extend.code;
			if(payType == 1)
				document.getElementById("payType").innerHTML = "已缴费";
			else
				document.getElementById("payType").innerHTML = "未缴费";
			if(payType == 1)
			{
				document.getElementById("downButton").style.display="none";
				document.getElementById("downWord").innerHTML = "<div>报名与缴费已成功！！！</div><div>请考生在2018年3月15日早8：00开始自行打印准考证！！！</div>";
			}
		}
	});
});